package com.wteam.dragon.model.pojo.dto;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

/**
 * @Author 陈晓辉
 * @Date 2020/4/1 19:52
 */
@Data
@TableName("menu")
public class MenuDto implements Comparable<MenuDto> , Serializable{

    @TableId(type = IdType.AUTO)
    private Long id;

    private String title;

    private Long sort;

    private String name;

    private String permission;

    private String icon;

    private Boolean cache;

    private Boolean hidden;

    private Long pid;

    private Boolean iframe;

    private Timestamp createTime;

    private String child;

    @TableLogic
    private Boolean isDelete;

    @TableField(exist = false)
    private List<MenuDto> children;

    @Override
    public int compareTo(MenuDto o) {
        return (int)(this.getSort().longValue() - o.getSort().longValue());
    }

}
